<div class="tableToolbar">
    <div class="coll-md-8" id="addInput">
        <div class="coll-md-1 " id="search1">
            <div class="coll-md-10 triangle">
                <select class="form-control" ng-model="itemsearch.itemStatus">
                    <option selected disabled hidden value="">选择标地状态</option>
                    <!--<option value="" disabled selected hidden>状态</option>-->
                    <option  value="">全部</option>
                    <option value="0">开始</option>
                    <option value="1">等待开放</option>
                    <option value="10">开放</option>
                    <option value="20">项目满标</option>
                    <option value="21">满标成功</option>
                    <option value="30">复审通过待还款</option>
                    <option value="31">部分还款</option>
                    <option value="32">还款成功</option>
                </select>
            </div>
        </div>
        <div class="coll-md-1 " id="search2">
            <div class="coll-md-10">
                <input type="text" class='search' placeholder="请输入资产方" ng-model="itemsearch.companyName">
            </div>
        </div>
        <div class="coll-md-1 " id="search3">
            <div class="coll-md-10 triangle">
                <select class="form-control" ng-model="itemsearch.itemRepayMethod">
                    <option selected disabled hidden value="">选择还款方式</option>
                    <option  value=''>全部</option>
                    <option value="1">一次性还款</option>
                    <option value="2">等额本息</option>
                    <option value="3">先息后本</option>
                    <option value="4">每日付息</option>
                    <option value="5">等额本金</option>
                </select>
            </div>
        </div>
        <div class="coll-md-2">
            <input type="text" class='search' placeholder="标地名称、ID" ng-model="itemsearch.itemName">
        </div>
        <div class="coll-md-3 scalenone"  id="searchdate" datahide>
            <div class="coll-md-5" >
                <p class="input-group">
                    <input type="text" class="search" placeholder="添加开始时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="itemsearch.beginDateTimex" is-open="popup1.opened" datepicker-options="dateOptions"/>
                    <span class="input-group-btn">
                        <button type="button" class="small-icon btn btn-default" ng-click="open1()"><i class="glyphicon glyphicon-calendar"></i></button>
                    </span>
                </p>
            </div>
            <div class="coll-md-5">
                <p class="input-group inline">
                    <input type="text" class="search" placeholder="添加结束时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="itemsearch.endDateTimex" is-open="popup2.opened" datepicker-options="dateOptions"/>
                    <span class="input-group-btn">
                        <button type="button" class="small-icon btn btn-default" ng-click="open2()"><i class="glyphicon glyphicon-calendar"></i></button>
                    </span>
                </p>
            </div>
        </div>
        <div class="coll-md-2">
            <input type="button" class="small-icon search2-icon" value="搜索" ng-click="search()">
            <input type="button" class="small-icon search2" value="搜索">
            <input type="button" class="small-icon reset-icon" reset-icon value="重置" ng-click="reset()">
            <input type="button" class="small-icon reset" value="重置">

            <div class="dropdown-menu-right">
                <input type="button" class="small-icon more-icon" value="更多" title='更多搜索项' id="more-icon" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                <input type="button" class="small-icon more" value="更多">
                <ul class="dropdown-menu" style='margin-left:80px;' aria-labelledby="dropdownMenu2" more-search>
                    <li><a href="javascript:;">日期搜索</a></li>
                    <!--<li><a href="javascript:;">状态搜索</a></li>-->
                </ul>
            </div>
        </div>
    </div>
    <div class="coll-md-2">
        <!--<input type="button" class="bttn pos-left"  ng-click="addOrderModal()" value="新建">-->
        <button class="small-icon btn btn-default pos-right" ng-click="download()">
            <i class="fa fa-download" ></i>
        </button>
    </div>
</div>


<table style="margin-bottom:20px;">
    <tr>
        <td class="red">
            <h6>共计资产 </h6>
            <h4 ng-model="stat.productNum">{{stat.productNum}}个</h4>
        </td>
        <td class="blue" style="width: 40%;">
            <h6 > 应付：</h6>
            <h4 style="float: left;margin-left: 7rem;"> 本金</h4>
            <h4 style="float: left;margin-left: 2rem;margin-right: 2rem;" ng-model="stat.repayPrincipal">{{stat.repayPrincipal}}元</h4>
            <h4 style="float: left;margin-right: 2rem;"> + </h4>
            <h4 style="float: left;"> 利息</h4>
            <h4 style="float: left;margin-left: 2rem;margin-right: 2rem;" ng-model="stat.repayInterest">{{stat.repayInterest}}元</h4>
            <h4 style="float: left;margin-left: 2rem;margin-right: 2rem;"> 共计</h4>
            <h4 style="float: left;" ng-model="stat.repayAmount">{{stat.repayAmount}}元</h4>
        </td>
        <td class="red" style="width: 40%;">
            <h6 > 应收：</h6>
            <h4 style="float: left;margin-left: 7rem;"> 本金</h4>
            <h4 style="float: left;margin-left: 2rem;margin-right: 2rem;" ng-model="stat.collectPrincipal">{{stat.collectPrincipal}}元</h4>
            <h4 style="float: left;margin-right: 2rem;" > + </h4>
            <h4 style="float: left;" > 利息</h4>
            <h4 style="float: left;margin-left: 2rem;margin-right: 2rem;" ng-model="stat.collectInterest">{{stat.collectInterest}}元</h4>
            <h4 style="float: left;margin-left: 2rem;margin-right: 2rem;"> 共计</h4>
            <h4 style="float: left;" ng-model="stat.collectAmount">{{stat.collectAmount}}元</h4>
        </td>
    </tr>
</table>


<table ui-table="orderParams">
    <thead>
    <tr>
        <th>ID</th>
        <th>标地名称</th>
        <th>资产方</th>
        <th>金额</th>
        <th>利率</th>
        <th>期数</th>
        <th>已收本金</th>
        <th>已收利息</th>
        <th>已收小计</th>
        <th>余收本金</th>
        <th>余收利息</th>
        <th>余收小计</th>
        <th>利率</th>
        <th>已付本金</th>
        <th>已付利息</th>
        <th>已付小计</th>
        <th>余付本金</th>
        <th>余付利息</th>
        <th>余付小计</th>
        <th>状态</th>
        <th>查看</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="item in orderParams.$rows">
        <td>{{item.id}}</td>
        <td>{{item.itemName}}</td>
        <td>{{item.companyName}}</td>
        <td>{{item.itemAccount | orderNum}}</td>
        <td>{{item.itemRate }}%</td>
        <td>{{item.periods | periodsNum}}</td>
        <td>{{item.recivedPrincipal}}</td>
        <td>{{item.recivedInterest}}</td>
        <td>{{item.recivedAmount}}</td>
        <td>{{item.restRecivePrincipal}}</td>
        <td>{{item.restReciveInterest}}</td>
        <td>{{item.restReciveAmount}}</td>
        <td>{{item.productRate}}%</td>
        <td>{{item.paidPrincipal}}</td>
        <td>{{item.paidInterest}}</td>
        <td>{{item.paidAmount}}</td>
        <td>{{item.restPayPrincipal}}</td>
        <td>{{item.restPayInterest}}</td>
        <td>{{item.restPayAmount}}</td>
        <td>{{item.itemStatus | itemStatusFilter}}</td>
        <td>
            <!--<button type="submit" class="btn blue"  ng-disabled="myForm.$invalid" ng-click="imgBtn()" style="float: right">确认</button>-->
            <a ng-click="openViewModal(item.id)">详情</a>
        </td>
    </tr>
    </tbody>
</table>


<modal title="查看项目" visible="viewItemModal">
    <form class="form-horizontal" role="form">
        <div class="form-body">
            <!--<ul  class="nav nav-tabs">-->
                <!--<li class="active"><a  href="#item21" data-toggle="tab" ng-click="info()">资产方还款明细</a></li>-->
                <!--<li><a  href="#item25" data-toggle="tab" ng-click="info()">还款计划</a></li>-->
                <!--<li><a   href="#item27" data-toggle="tab" ng-click="info()">投资方付款明细</a></li>-->
                <!--<li><a  href="#item23" data-toggle="tab" ng-click="info()">付款计划</a></li>-->
            <!--</ul>-->
            <div class="scrollArea">
                <div style="margin-top:10px;">

                    <div id="item21" class="col-md-49" style="border-bottom: 1px solid black;padding-bottom: 15px">
                        <h6>资产方还款明细</h6>
                        <div class="row">
                            <div class="col-md-35" style="padding-left: 15px">
                                总计:{{statRepay.totalAmount+'元'}}
                            </div>
                            <div class="col-md-15">
                                利息:{{statRepay.itemRate+'%'}}
                            </div>
                            <div class="col-md-65">
                                还款方式:{{statRepay.itemRepayMethod | repayMethod}}
                            </div>
                            <div class="col-md-75">
                                总计应收:{{statRepay.totalRepayAmount+'元'}}
                            </div>
                            <!--<div class="col-md-6">-->
                                <!--<div class="form-group">-->
                                    <!--<label class="control-label col-md-4">总计应收</label>-->
                                    <!--<div class="col-md-8">-->
                                        <!--<input type="text" class="form-control" ng-model="statRepay.totalRepayAmount+'元'"  readonly="readonly">-->
                                    <!--</div>-->
                                <!--</div>-->
                            <!--</div>-->

                        </div>
                    </div>

                    <div id="item27" class="col-md-49" style="border-left: 1px solid black;border-bottom: 1px solid black;padding-bottom: 15px">
                        <h6>投资方付款明细</h6>
                        <div class="row">
                            <div class="col-md-35" style="padding-left: 15px">
                                总计:{{statCollect.totalCollectAmount+'元'}}
                            </div>
                            <div class="col-md-15">
                                利息:{{statCollect.itemRate+'%'}}
                            </div>
                            <div class="col-md-65">
                                还款方式:{{statCollect.itemRepayMethod | repayMethod}}
                            </div>
                            <div class="col-md-75">
                                总计应收:{{statCollect.totalCollectPrincipal+'元'}}
                            </div>
                            <!--<div class="col-md-6">-->
                                <!--<div class="form-group">-->
                                    <!--<label class="control-label col-md-4">总计应收</label>-->
                                    <!--<div class="col-md-8">-->
                                        <!--<input type="text" class="form-control" ng-model="statCollect.totalCollectPrincipal+'元'"  readonly="readonly">-->
                                    <!--</div>-->
                                <!--</div>-->
                            <!--</div>-->
                        </div>
                    </div>

                    <div id="item25" class="col-md-49">
                        <h6>还款明细</h6>

                        <table>
                            <thead>
                                <tr>
                                    <th>时间</th>
                                    <th>本金</th>
                                    <th>利息</th>
                                    <th>总计</th>
                                    <th>还款</th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr ng-repeat="item in getRepayList">
                                    <td>{{item.repayTime | date:'yyyy-MM-dd'}}</td>
                                    <td>{{item.repayPrincipal}}元</td>
                                    <td>{{item.repayInterest}}元</td>
                                    <td>{{item.repayAmount}}元</td>
                                    <td>{{item.actualRepayAmount}}元</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div id="item23" class="col-md-49" style="border-left: 1px solid black">
                        <h6>付款计划</h6>
                        <table>
                            <thead>
                                <tr>
                                    <th>投资人</th>
                                    <th>投资金额</th>
                                    <th>应收利息</th>
                                    <th>总计</th>
                                    <th>已付</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody ng-repeat="item in getCollect track by $index">
                                    <tr>
                                        <td>{{item.userId}}</td>
                                        <td>{{item.investAmount}}元</td>
                                        <td>{{item.collectInterest}}元</td>
                                        <td>{{item.collectAmount}}元</td>
                                        <td>{{item.actualCollectAmount}}元</td>
                                        <td><span ng-click="perDetails(item.id,item.userId,$index)" style="cursor: pointer;margin-left: 10px;">v</span></td>
                                    </tr>
                                    <tr class="parent" ng-show="facePanel[$index]" style="margin: 0 auto;">
                                        <th>时间</th>
                                        <th>本金</th>
                                        <th>利息</th>
                                        <th>总计</th>
                                        <th>还款</th>
                                    </tr>
                                    <tr class="son" ng-repeat="item in getPerDetails" ng-show="facePanel[$parent.$index]" style="margin: 0 auto;">
                                        <td>{{item.collectTime}}</td>
                                        <td>{{item.collectPrincipal}}元</td>
                                        <td>{{item.collectInterest}}元</td>
                                        <td>{{item.collectAmount}}元</td>
                                        <td>{{item.actualCollectAmount}}元</td>
                                    </tr>
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
    </form>
</modal>
